var obj = {}; obj.a = 100;
var arr = []; arr.a = 100;
function fn () {}
fn.a = 100;

console.log(obj.__proto__);
console.log(arr.__proto__);
console.log(fn.__proto__);

console.log(fn.prototype)

console.log(obj.__proto__=== Object.prototype)

//构 造函数，验证第五条规则
function Foo(name, age) {
    this.name = name 
}
Foo.prototype.alertName = function () {
    console.log(this.name)
}

var f =new Foo('zhaojiawei')
f.printName = function () {
    console.log(this.name)
}

f.printName()
f.alertName()
f.toString() //要去f.__proto__.__proto__中查找
//只能拿到自身属性，不能拿到f原型属性。
var item;
for(item in f) {
    if (f.hasOwnProperty(item)) {
        console.log(item)
    }
}